Update style builder tool for Standard style support#24
Conversation
| .optional() | ||
| .describe( | ||
| 'Layer slot for Mapbox Standard styles. Controls layer stacking order. ' + | ||
| 'Bottom: below most map features, Middle: between base and labels, Top: above all base map features (default)' |
There was a problem hiding this comment.
| 'streets-v11', | ||
| 'light-v10', | ||
| 'dark-v10', | ||
| 'satellite-v9', | ||
| 'satellite-streets-v11', | ||
| 'outdoors-v11' |
There was a problem hiding this comment.
We have a newer version of those styles.
https://docs.mapbox.com/api/maps/styles/#classic-mapbox-styles
There was a problem hiding this comment.
fixed with new versions
| // 'dark', | ||
| // 'satellite', | ||
| // 'outdoors' | ||
| // ].includes(baseStyle); |
There was a problem hiding this comment.
[nit] Consider to remove the comment.
| class: { | ||
| description: 'Waterway classification', | ||
| description: 'class field', |
There was a problem hiding this comment.
[nit] if those description are only <key> field, it will not help with the context, consider to remove them.
There was a problem hiding this comment.
removed these fields, indeed, they are not useful for context
| waterway: { | ||
| iso_3166_1: { | ||
| description: 'iso_3166_1 field', | ||
| values: [ |
There was a problem hiding this comment.
[nit] The iso_3166_1 list could be the same for each layer, consider puting them in one place, and referring to it, instead of listing it duplicate times.
There was a problem hiding this comment.
made a solution so that there one shared constant for all - reducing a lot of lines
| sections.push('**LineString layers:**'); | ||
| sections.push('- `road` - All roads, paths, railways'); | ||
| sections.push('- `admin` - Administrative boundaries'); | ||
| sections.push('- `waterway` - Rivers, streams, canals as lines'); | ||
| sections.push('- `aeroway` - Airport runways and taxiways'); | ||
| sections.push('- `structure` - Bridges, tunnels, fences'); | ||
| sections.push('- `natural_label` - Natural feature label placement paths'); | ||
| sections.push(''); | ||
| sections.push('**Point layers:**'); | ||
| sections.push('- `place_label` - City, state, country labels'); | ||
| sections.push('- `poi_label` - Points of interest'); | ||
| sections.push('- `airport_label` - Airport labels'); | ||
| sections.push('- `transit_stop_label` - Transit stops'); | ||
| sections.push('- `motorway_junction` - Highway exits'); | ||
| sections.push('- `housenum_label` - House numbers'); | ||
| sections.push(''); | ||
| sections.push('## Layer Types and Properties'); | ||
| sections.push(''); |
There was a problem hiding this comment.
[nit] Those push likes hard, consider a better way to add?
I don't have a better way yet, but just one example
sections.push([
'**LineString layers:**',
'- `road` - All roads, paths, railways',
'- `admin` - Administrative boundaries',
'- `waterway` - Rivers, streams, canals as lines',
'- `aeroway` - Airport runways and taxiways',
'- `structure` - Bridges, tunnels, fences',
'- `natural_label` - Natural feature label placement paths',
'',
'**Point layers:**',
'- `place_label` - City, state, country labels',
'- `poi_label` - Points of interest',
'- `airport_label` - Airport labels',
'- `transit_stop_label` - Transit stops',
'- `motorway_junction` - Highway exits',
'- `housenum_label` - House numbers',
'',
'## Layer Types and Properties',
''
].join('\n'));
There was a problem hiding this comment.
good point, i've done something similar now - now there are less push statements, one per "section"


Description
Summary
maritimeanddisputedas strings)Changes
New Features
Standard Style Support: StyleBuilderTool now creates modern Mapbox Standard styles by default
importsto inherit frommapbox://styles/mapbox/standardmapbox:uiParadigm: 'imports'slotproperty to layers for Standard stylesStyle Type Options: Three base style options available:
standard(default): Modern style with imports and slotsclassic: Traditional style with direct sources (being deprecated)blank: Minimal style with basic sources, no importsBug Fixes
Admin Layer Filters: Fixed filter generation for country/state boundaries
maritimeanddisputedare now correctly treated as strings ("true"/"false") not booleansImprovements
Response Size Optimization: Added
filterExpandedMapboxStylesutility to remove expanded style data from APIresponses
Enhanced Layer Configuration:
Testing
Added unit tests + test cases in the style builder tool doc
Checklist
Additional Notes